﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Company.Axis
{
    public class AxisMotionParameter : BindableBase
    {
        #region 字段
        private string _NameOfAxis = "Here is name of axis";
        private double _TargetPosition = 1000;

        private double _TargetVelocity = 100;

        private double _TargetAcceleration = 1000;

        private double _TargetDeceleration = 1000;

        private double _TargetKillDeceleration = 10000;

        private double _TargetJerk = 10000;

        private double _TargetSoftRightLimit;

        private double _TargetSoftLeftLimit;

        private double _CurrentReferencePosition;

        private double _CurrentFeedbackPosition;

        private double _CurrentVelocity;

        private double _CurrentPositionError;

        private int _CurrentAxisId;

        private double _CurrentSoftRightLimit;

        private double _CurrentSoftLeftLimit;

        private double _CurrentKillDeceleration;

        private double _CurrentAcceleration;

        private double _CurrentDeceleration;

        private double _CurrentJerk;
        #endregion
        #region 属性
        public string NameOfAxis
        {
            get { return _NameOfAxis; }
            set { _NameOfAxis = value; RaisePropertyChanged(); }
        }

        public int CurrentAxisId
        {
            get 
            {
                if (_CurrentAxisId <= 0) _CurrentAxisId = 0;
                return _CurrentAxisId; 
            }
            set { _CurrentAxisId = value; RaisePropertyChanged(); }
        }

        public double CurrentPositionError
        {
            get { return _CurrentPositionError; }
            set { _CurrentPositionError = value; RaisePropertyChanged(); }
        }

        public double CurrentVelocity
        {
            get { return _CurrentVelocity; }
            set { _CurrentVelocity = value; RaisePropertyChanged(); }
        }

        public double CurrentFeedbackPosition
        {
            get { return _CurrentFeedbackPosition; }
            set { _CurrentFeedbackPosition = value; RaisePropertyChanged(); }
        }

        public double CurrentReferencePosition
        {
            get { return _CurrentReferencePosition; }
            set { _CurrentReferencePosition = value; RaisePropertyChanged(); }
        }

        public double CurrentSoftRightLimit
        {
            get { return _CurrentSoftRightLimit; }
            set { _CurrentSoftRightLimit = value; RaisePropertyChanged(); }
        }

        public double CurrentSoftLeftLimit
        {
            get { return _CurrentSoftLeftLimit; }
            set { _CurrentSoftLeftLimit = value; RaisePropertyChanged(); }
        }

        public double CurrentKillDeceleration
        {
            get { return _CurrentKillDeceleration; }
            set { _CurrentKillDeceleration = value; RaisePropertyChanged(); }
        }

        public double CurrentAcceleration
        {
            get { return _CurrentAcceleration; }
            set { _CurrentAcceleration = value; RaisePropertyChanged(); }
        }

        public double CurrentDeceleration
        {
            get { return _CurrentDeceleration; }
            set { _CurrentDeceleration = value; RaisePropertyChanged(); }
        }

        public double CurrentJerk
        {
            get { return _CurrentJerk; }
            set { _CurrentJerk = value; RaisePropertyChanged(); }
        }

        public double TargetJerk
        {
            get { return _TargetJerk; }
            set { _TargetJerk = value; RaisePropertyChanged(); }
        }

        public double TargetKillDeceleration
        {
            get { return _TargetKillDeceleration; }
            set { _TargetKillDeceleration = value; RaisePropertyChanged(); }
        }

        public double TargetDeceleration
        {
            get { return _TargetDeceleration; }
            set { _TargetDeceleration = value; RaisePropertyChanged(); }
        }

        public double TargetAcceleration
        {
            get { return _TargetAcceleration; }
            set { _TargetAcceleration = value; RaisePropertyChanged(); }
        }

        public double TargetVelocity
        {
            get { return _TargetVelocity; }
            set { _TargetVelocity = value; RaisePropertyChanged(); }
        }

        public double TargetPosition
        {
            get { return _TargetPosition; }
            set { _TargetPosition = value; RaisePropertyChanged(); }
        }

        public double TargetSoftRightLimit
        {
            get { return _TargetSoftRightLimit; }
            set { _TargetSoftRightLimit = value; RaisePropertyChanged(); }
        }
        
        public double TargetSoftLeftLimit
        {
            get { return _TargetSoftLeftLimit; }
            set { _TargetSoftLeftLimit = value; RaisePropertyChanged(); }
        }

        #endregion
    }
}
